/**
 * 获取产品数据
 */
define(function (require, exports, module) {
    var aw = require("ajaxwrapper");
    module.exports = {
    	getproductType:function(pkProduct,callback){
    		aw.ajax({
				url:"api/producttype/query",
				data:{
					"product.pkProduct":pkProduct,
					"seal":false,
					"fetchProperties":"pkProductType,name"
				},
				dataType:"json",
				success:function(data){
					callback(data);
				}
			});
    	},
    	getproductBatch:function(pkProduct,pkProductType,callback){
    		aw.ajax({
				url:"api/travelcontract/queryproductbatch",
				data:{
					"productRule.product.pkProduct":pkProduct,
					"productType.pkProductType":pkProductType,
					"productBatch.seal":false
				},
				dataType:"json",
				success:function(data){
					callback(data);
				}
			});
    	},
    	getproductDetail:function(pkProductType,pkProductBatch,callback){
    		aw.ajax({
    			url:"api/travelcontract/getproductdetail",
    			data:{
    				//"productRule.product.pkProduct":pkProduct,
    				"productType.pkProductType":pkProductType,
    				"productBatch.pkProductBatch":pkProductBatch,
    				"productBatch.seal":false
    			},
    			dataType:"json",
    			success:function(data){
    				callback(data);
    			}
    		});
    	}
    };
});
